package com.dycong.common.IO.netty.ssl;

import javax.net.ssl.X509TrustManager;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

/**
 * Created by dycong on 2017/4/5.
 */
public class SelfX509TrustManager implements X509TrustManager {
    @Override
    public void checkClientTrusted(X509Certificate[] var1, String var2) throws CertificateException {
        System.err.println(
                "UNKNOWN CLIENT CERTIFICATE: " + var1[0].getSubjectDN());
    }

    @Override
    public void checkServerTrusted(X509Certificate[] var1, String var2) throws CertificateException {
        System.err.println(
                "UNKNOWN Server CERTIFICATE: " + var1[0].getSubjectDN());
    }

    @Override
    public X509Certificate[] getAcceptedIssuers() {
        return null;
    }

}
